package com.zatech.cgnci.project.base.context;

import com.zatech.cgnci.project.entity.UserEntity;

public class UserContext {

    private static final ThreadLocal<UserEntity> USER_CONTEXT = new ThreadLocal<>();

    public static void setUser(UserEntity userEntity){
        USER_CONTEXT.set(userEntity);
    }

    public static UserEntity getUser(){
        return USER_CONTEXT.get();
    }

    public static void removeUser(){
        USER_CONTEXT.remove();
    }

}
